﻿using ETS.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ETS.Implements
{
    /// <summary>
    /// 绘图评分树
    /// </summary>
    public class VignetteScoringTreeApp : ScoringTreeApp
    {
        /// <summary>
        /// 构建树
        /// 把对象组合起来
        /// </summary>
        /// <returns></returns>
        public override AbstractEvaluator BuildTree()
        {
            #region Addition加法
            AbstractEvaluator carryEvaluator = new CarryFeatureLeaf("Carry考察");

            AbstractEvaluator propertiesEvaluator = new PropertiesFeatureLeaf("Properties考察");

            FeatureGroup featureGroupAddition = new FeatureGroup("Addition");
            //添加评分器
            featureGroupAddition.AddEvaluator(carryEvaluator, 2);//Carry
            featureGroupAddition.AddEvaluator(propertiesEvaluator, 1);//Properties
            #endregion

            #region Subtraction减法
            AbstractEvaluator borrowEvaluator1 = new BorrowFeatureLeaf("Borrow考察");
           
            AbstractEvaluator properties2Evaluator = new Properties2FeatureLeaf("Properties2考察");

            FeatureGroup featureGroupSubtraction = new FeatureGroup("Subtraction");
            //添加评分器
            featureGroupSubtraction.AddEvaluator(borrowEvaluator1, 2);//Borrow
            featureGroupSubtraction.AddEvaluator(properties2Evaluator, 1);//Properties2
            #endregion

            #region Terms
            FeatureGroup termsFeatureGroup = new FeatureGroup("Terms");
            //添加评分器
            termsFeatureGroup.AddEvaluator(featureGroupSubtraction, 2);//Subtraction减法
            termsFeatureGroup.AddEvaluator(featureGroupAddition, 2);//Addition加法
            #endregion

            return termsFeatureGroup;
        }
    }
}
